package com.kalaqia.icon.font;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.kalaqia.icon.view.IconVerticalView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.layout_demo);

        IconVerticalView view = findViewById(R.id.id2);
        view.setContentColor(Color.RED);
        view.setOnClickListener(view1 -> {
            Toast.makeText(MainActivity.this, "click", Toast.LENGTH_SHORT).show();
        });
//        view.labelDrawStart(R.mipmap.ic_launcher, this);

        IconVerticalView mAbout = findViewById(R.id.id_more_about);

        int size = getResources().getDimensionPixelSize(R.dimen.dimen_15sp);
//        Drawable drawable = ContextCompat.getDrawable(this, R.mipmap.ic_launcher);
//
//        if (drawable == null) {
//            return;
//        }
//        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
//        mAbout.labelDrawStart(R.mipmap.ic_launcher);

//        IconFontTextView mStateView = new IconFontTextView.Builder(this)
//                .setIcon(getString(R.string.icon_font_right))
//                .setType(IconFontTextView.ICON_TYPE_RIGHT)
//                .setTextValue("加载中...")
//                .setTextSize(getResources().getDimensionPixelOffset(R.dimen.dimen_13sp))
//                .setIconTypeface(R.font.font_icon_shop)
//                .build();
//        mStateView.setTextColor(ContextCompat.getColor(this,R.color.color_hint_text));
//        ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
//        mStateView.setLayoutParams(lp);
////
//        FrameLayout layout = findViewById(R.id.id_root);
//        layout.addView(mStateView);
//
//        mStateView.setOnClickListener(view -> {
//            mStateView.setTextValue("暂无数据").drawIconTop(getString(R.string.icon_font_empty));
//        });


    }
}
